#!/usr/bin/env python3
# coding=utf-8
'''
说明：
'''
from win32com import client
WordApp  = client.Dispatch('Word.Application')
WordApp .Visible = 0
WordApp .DisplayAlerts = 0
doc = WordApp.Documents.Open( 'E:\\Code\\WorkWithPy\\office_app\\docxtest\\demo.docx')
# sel = WordApp.Selection
# pic = sel.InlineShapes.AddPicture(r'0002莫新发.jpg',False,True)
#
# pic.ConvertToShape()
# pic.Top =30
table = doc.Tables[0]
cell_range=table.Cell(0,6).Range
#cell_range.ParagraphFormat.LineSpacingRule = client.constants.wdLineSpaceSingle

current_pic = cell_range.InlineShapes.AddPicture('E:\\Code\\WorkWithPy\\office_app\\docxtest\\0002莫新发.jpg')



doc.SaveAs('E:\\Code\\WorkWithPy\\office_app\\docxtest\\demo1.doc')		# 文档保存
doc.Close(-1)
